#pragma once
// MESSAGE SET_PID3 PACKING

#define MAVLINK_MSG_ID_SET_PID3 193

MAVPACKED(
typedef struct __mavlink_set_pid3_t {
 int16_t pid7_p; /*<  PID7_P*/
 int16_t pid7_i; /*<  PID7_I*/
 int16_t pid7_d; /*<  PID7_D*/
 int16_t pid8_p; /*<  PID8_P*/
 int16_t pid8_i; /*<  PID8_I*/
 int16_t pid8_d; /*<  PID8_D*/
 int16_t pid9_p; /*<  PID9_P*/
 int16_t pid9_i; /*<  PID9_I*/
 int16_t pid9_d; /*<  PID9_D*/
}) mavlink_set_pid3_t;

#define MAVLINK_MSG_ID_SET_PID3_LEN 18
#define MAVLINK_MSG_ID_SET_PID3_MIN_LEN 18
#define MAVLINK_MSG_ID_193_LEN 18
#define MAVLINK_MSG_ID_193_MIN_LEN 18

#define MAVLINK_MSG_ID_SET_PID3_CRC 147
#define MAVLINK_MSG_ID_193_CRC 147



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_SET_PID3 { \
    193, \
    "SET_PID3", \
    9, \
    {  { "pid7_p", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_set_pid3_t, pid7_p) }, \
         { "pid7_i", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_set_pid3_t, pid7_i) }, \
         { "pid7_d", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_set_pid3_t, pid7_d) }, \
         { "pid8_p", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_set_pid3_t, pid8_p) }, \
         { "pid8_i", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_set_pid3_t, pid8_i) }, \
         { "pid8_d", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_set_pid3_t, pid8_d) }, \
         { "pid9_p", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_set_pid3_t, pid9_p) }, \
         { "pid9_i", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_set_pid3_t, pid9_i) }, \
         { "pid9_d", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_set_pid3_t, pid9_d) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_SET_PID3 { \
    "SET_PID3", \
    9, \
    {  { "pid7_p", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_set_pid3_t, pid7_p) }, \
         { "pid7_i", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_set_pid3_t, pid7_i) }, \
         { "pid7_d", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_set_pid3_t, pid7_d) }, \
         { "pid8_p", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_set_pid3_t, pid8_p) }, \
         { "pid8_i", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_set_pid3_t, pid8_i) }, \
         { "pid8_d", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_set_pid3_t, pid8_d) }, \
         { "pid9_p", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_set_pid3_t, pid9_p) }, \
         { "pid9_i", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_set_pid3_t, pid9_i) }, \
         { "pid9_d", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_set_pid3_t, pid9_d) }, \
         } \
}
#endif

/**
 * @brief Pack a set_pid3 message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param pid7_p  PID7_P
 * @param pid7_i  PID7_I
 * @param pid7_d  PID7_D
 * @param pid8_p  PID8_P
 * @param pid8_i  PID8_I
 * @param pid8_d  PID8_D
 * @param pid9_p  PID9_P
 * @param pid9_i  PID9_I
 * @param pid9_d  PID9_D
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_set_pid3_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               int16_t pid7_p, int16_t pid7_i, int16_t pid7_d, int16_t pid8_p, int16_t pid8_i, int16_t pid8_d, int16_t pid9_p, int16_t pid9_i, int16_t pid9_d)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_SET_PID3_LEN];
    _mav_put_int16_t(buf, 0, pid7_p);
    _mav_put_int16_t(buf, 2, pid7_i);
    _mav_put_int16_t(buf, 4, pid7_d);
    _mav_put_int16_t(buf, 6, pid8_p);
    _mav_put_int16_t(buf, 8, pid8_i);
    _mav_put_int16_t(buf, 10, pid8_d);
    _mav_put_int16_t(buf, 12, pid9_p);
    _mav_put_int16_t(buf, 14, pid9_i);
    _mav_put_int16_t(buf, 16, pid9_d);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_PID3_LEN);
#else
    mavlink_set_pid3_t packet;
    packet.pid7_p = pid7_p;
    packet.pid7_i = pid7_i;
    packet.pid7_d = pid7_d;
    packet.pid8_p = pid8_p;
    packet.pid8_i = pid8_i;
    packet.pid8_d = pid8_d;
    packet.pid9_p = pid9_p;
    packet.pid9_i = pid9_i;
    packet.pid9_d = pid9_d;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_PID3_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_SET_PID3;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_PID3_MIN_LEN, MAVLINK_MSG_ID_SET_PID3_LEN, MAVLINK_MSG_ID_SET_PID3_CRC);
}

/**
 * @brief Pack a set_pid3 message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param pid7_p  PID7_P
 * @param pid7_i  PID7_I
 * @param pid7_d  PID7_D
 * @param pid8_p  PID8_P
 * @param pid8_i  PID8_I
 * @param pid8_d  PID8_D
 * @param pid9_p  PID9_P
 * @param pid9_i  PID9_I
 * @param pid9_d  PID9_D
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_set_pid3_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   int16_t pid7_p,int16_t pid7_i,int16_t pid7_d,int16_t pid8_p,int16_t pid8_i,int16_t pid8_d,int16_t pid9_p,int16_t pid9_i,int16_t pid9_d)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_SET_PID3_LEN];
    _mav_put_int16_t(buf, 0, pid7_p);
    _mav_put_int16_t(buf, 2, pid7_i);
    _mav_put_int16_t(buf, 4, pid7_d);
    _mav_put_int16_t(buf, 6, pid8_p);
    _mav_put_int16_t(buf, 8, pid8_i);
    _mav_put_int16_t(buf, 10, pid8_d);
    _mav_put_int16_t(buf, 12, pid9_p);
    _mav_put_int16_t(buf, 14, pid9_i);
    _mav_put_int16_t(buf, 16, pid9_d);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_PID3_LEN);
#else
    mavlink_set_pid3_t packet;
    packet.pid7_p = pid7_p;
    packet.pid7_i = pid7_i;
    packet.pid7_d = pid7_d;
    packet.pid8_p = pid8_p;
    packet.pid8_i = pid8_i;
    packet.pid8_d = pid8_d;
    packet.pid9_p = pid9_p;
    packet.pid9_i = pid9_i;
    packet.pid9_d = pid9_d;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_PID3_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_SET_PID3;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_PID3_MIN_LEN, MAVLINK_MSG_ID_SET_PID3_LEN, MAVLINK_MSG_ID_SET_PID3_CRC);
}

/**
 * @brief Encode a set_pid3 struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param set_pid3 C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_set_pid3_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_pid3_t* set_pid3)
{
    return mavlink_msg_set_pid3_pack(system_id, component_id, msg, set_pid3->pid7_p, set_pid3->pid7_i, set_pid3->pid7_d, set_pid3->pid8_p, set_pid3->pid8_i, set_pid3->pid8_d, set_pid3->pid9_p, set_pid3->pid9_i, set_pid3->pid9_d);
}

/**
 * @brief Encode a set_pid3 struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param set_pid3 C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_set_pid3_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_pid3_t* set_pid3)
{
    return mavlink_msg_set_pid3_pack_chan(system_id, component_id, chan, msg, set_pid3->pid7_p, set_pid3->pid7_i, set_pid3->pid7_d, set_pid3->pid8_p, set_pid3->pid8_i, set_pid3->pid8_d, set_pid3->pid9_p, set_pid3->pid9_i, set_pid3->pid9_d);
}

/**
 * @brief Send a set_pid3 message
 * @param chan MAVLink channel to send the message
 *
 * @param pid7_p  PID7_P
 * @param pid7_i  PID7_I
 * @param pid7_d  PID7_D
 * @param pid8_p  PID8_P
 * @param pid8_i  PID8_I
 * @param pid8_d  PID8_D
 * @param pid9_p  PID9_P
 * @param pid9_i  PID9_I
 * @param pid9_d  PID9_D
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_set_pid3_send(mavlink_channel_t chan, int16_t pid7_p, int16_t pid7_i, int16_t pid7_d, int16_t pid8_p, int16_t pid8_i, int16_t pid8_d, int16_t pid9_p, int16_t pid9_i, int16_t pid9_d)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_SET_PID3_LEN];
    _mav_put_int16_t(buf, 0, pid7_p);
    _mav_put_int16_t(buf, 2, pid7_i);
    _mav_put_int16_t(buf, 4, pid7_d);
    _mav_put_int16_t(buf, 6, pid8_p);
    _mav_put_int16_t(buf, 8, pid8_i);
    _mav_put_int16_t(buf, 10, pid8_d);
    _mav_put_int16_t(buf, 12, pid9_p);
    _mav_put_int16_t(buf, 14, pid9_i);
    _mav_put_int16_t(buf, 16, pid9_d);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_PID3, buf, MAVLINK_MSG_ID_SET_PID3_MIN_LEN, MAVLINK_MSG_ID_SET_PID3_LEN, MAVLINK_MSG_ID_SET_PID3_CRC);
#else
    mavlink_set_pid3_t packet;
    packet.pid7_p = pid7_p;
    packet.pid7_i = pid7_i;
    packet.pid7_d = pid7_d;
    packet.pid8_p = pid8_p;
    packet.pid8_i = pid8_i;
    packet.pid8_d = pid8_d;
    packet.pid9_p = pid9_p;
    packet.pid9_i = pid9_i;
    packet.pid9_d = pid9_d;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_PID3, (const char *)&packet, MAVLINK_MSG_ID_SET_PID3_MIN_LEN, MAVLINK_MSG_ID_SET_PID3_LEN, MAVLINK_MSG_ID_SET_PID3_CRC);
#endif
}

/**
 * @brief Send a set_pid3 message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_set_pid3_send_struct(mavlink_channel_t chan, const mavlink_set_pid3_t* set_pid3)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_set_pid3_send(chan, set_pid3->pid7_p, set_pid3->pid7_i, set_pid3->pid7_d, set_pid3->pid8_p, set_pid3->pid8_i, set_pid3->pid8_d, set_pid3->pid9_p, set_pid3->pid9_i, set_pid3->pid9_d);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_PID3, (const char *)set_pid3, MAVLINK_MSG_ID_SET_PID3_MIN_LEN, MAVLINK_MSG_ID_SET_PID3_LEN, MAVLINK_MSG_ID_SET_PID3_CRC);
#endif
}

#if MAVLINK_MSG_ID_SET_PID3_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_set_pid3_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  int16_t pid7_p, int16_t pid7_i, int16_t pid7_d, int16_t pid8_p, int16_t pid8_i, int16_t pid8_d, int16_t pid9_p, int16_t pid9_i, int16_t pid9_d)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_int16_t(buf, 0, pid7_p);
    _mav_put_int16_t(buf, 2, pid7_i);
    _mav_put_int16_t(buf, 4, pid7_d);
    _mav_put_int16_t(buf, 6, pid8_p);
    _mav_put_int16_t(buf, 8, pid8_i);
    _mav_put_int16_t(buf, 10, pid8_d);
    _mav_put_int16_t(buf, 12, pid9_p);
    _mav_put_int16_t(buf, 14, pid9_i);
    _mav_put_int16_t(buf, 16, pid9_d);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_PID3, buf, MAVLINK_MSG_ID_SET_PID3_MIN_LEN, MAVLINK_MSG_ID_SET_PID3_LEN, MAVLINK_MSG_ID_SET_PID3_CRC);
#else
    mavlink_set_pid3_t *packet = (mavlink_set_pid3_t *)msgbuf;
    packet->pid7_p = pid7_p;
    packet->pid7_i = pid7_i;
    packet->pid7_d = pid7_d;
    packet->pid8_p = pid8_p;
    packet->pid8_i = pid8_i;
    packet->pid8_d = pid8_d;
    packet->pid9_p = pid9_p;
    packet->pid9_i = pid9_i;
    packet->pid9_d = pid9_d;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_PID3, (const char *)packet, MAVLINK_MSG_ID_SET_PID3_MIN_LEN, MAVLINK_MSG_ID_SET_PID3_LEN, MAVLINK_MSG_ID_SET_PID3_CRC);
#endif
}
#endif

#endif

// MESSAGE SET_PID3 UNPACKING


/**
 * @brief Get field pid7_p from set_pid3 message
 *
 * @return  PID7_P
 */
static inline int16_t mavlink_msg_set_pid3_get_pid7_p(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  0);
}

/**
 * @brief Get field pid7_i from set_pid3 message
 *
 * @return  PID7_I
 */
static inline int16_t mavlink_msg_set_pid3_get_pid7_i(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  2);
}

/**
 * @brief Get field pid7_d from set_pid3 message
 *
 * @return  PID7_D
 */
static inline int16_t mavlink_msg_set_pid3_get_pid7_d(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  4);
}

/**
 * @brief Get field pid8_p from set_pid3 message
 *
 * @return  PID8_P
 */
static inline int16_t mavlink_msg_set_pid3_get_pid8_p(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  6);
}

/**
 * @brief Get field pid8_i from set_pid3 message
 *
 * @return  PID8_I
 */
static inline int16_t mavlink_msg_set_pid3_get_pid8_i(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  8);
}

/**
 * @brief Get field pid8_d from set_pid3 message
 *
 * @return  PID8_D
 */
static inline int16_t mavlink_msg_set_pid3_get_pid8_d(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  10);
}

/**
 * @brief Get field pid9_p from set_pid3 message
 *
 * @return  PID9_P
 */
static inline int16_t mavlink_msg_set_pid3_get_pid9_p(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  12);
}

/**
 * @brief Get field pid9_i from set_pid3 message
 *
 * @return  PID9_I
 */
static inline int16_t mavlink_msg_set_pid3_get_pid9_i(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  14);
}

/**
 * @brief Get field pid9_d from set_pid3 message
 *
 * @return  PID9_D
 */
static inline int16_t mavlink_msg_set_pid3_get_pid9_d(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  16);
}

/**
 * @brief Decode a set_pid3 message into a struct
 *
 * @param msg The message to decode
 * @param set_pid3 C-struct to decode the message contents into
 */
static inline void mavlink_msg_set_pid3_decode(const mavlink_message_t* msg, mavlink_set_pid3_t* set_pid3)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    set_pid3->pid7_p = mavlink_msg_set_pid3_get_pid7_p(msg);
    set_pid3->pid7_i = mavlink_msg_set_pid3_get_pid7_i(msg);
    set_pid3->pid7_d = mavlink_msg_set_pid3_get_pid7_d(msg);
    set_pid3->pid8_p = mavlink_msg_set_pid3_get_pid8_p(msg);
    set_pid3->pid8_i = mavlink_msg_set_pid3_get_pid8_i(msg);
    set_pid3->pid8_d = mavlink_msg_set_pid3_get_pid8_d(msg);
    set_pid3->pid9_p = mavlink_msg_set_pid3_get_pid9_p(msg);
    set_pid3->pid9_i = mavlink_msg_set_pid3_get_pid9_i(msg);
    set_pid3->pid9_d = mavlink_msg_set_pid3_get_pid9_d(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_SET_PID3_LEN? msg->len : MAVLINK_MSG_ID_SET_PID3_LEN;
        memset(set_pid3, 0, MAVLINK_MSG_ID_SET_PID3_LEN);
    memcpy(set_pid3, _MAV_PAYLOAD(msg), len);
#endif
}
